package com.three.crm.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.three.crm.R;
import com.three.crm.bean.FileBean;

import java.util.List;

public class ImagePreviewAdapter extends BaseQuickAdapter<FileBean, BaseViewHolder> {

    public ImagePreviewAdapter(@Nullable List<FileBean> data) {
        super(R.layout.item_list_picture_preview,data);
    }

    public ImagePreviewAdapter() {
        super(R.layout.item_list_picture_preview);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, FileBean item) {
        Glide.with(mContext).load(item.getUrl()).placeholder(R.mipmap.ic_default_image).into((ImageView) helper.getView(R.id.iv_picture));
    }
}
